// factory/FarmMachineFactory.java
package org.example.factory;

import org.example.model.*;

public class FarmMachineFactory extends AbstractFarmMachineFactory {
    @Override
    public FarmMachine createFarmMachine(String type, String id) {
        switch (type.toLowerCase()) {
            case "播种机":
                return new Seeder(id);
            case "喷药机":
                return new Sprayer(id);
            case "收割机":
                return new Harvester(id);
            case "拖拉机":
                return new Tractor(id);
            default:
                throw new IllegalArgumentException("不支持的农机类型: " + type);
        }
    }
}